Xbasic

CEILING Function

Syntax

Integer_Result as N = CEILING(N number)

Arguments

number

Numeric

Description

Returns the smallest integer that is greater than or equal to a number.

Discussion

CEILING() returns the smallest integer that is greater than or equal to the specified Number.

Example

ceiling(12.3) ->  13
round(12.3, 0) ->  12

Note : Unlike ROUND(), CEILING() returns an integer closer to zero for negative numbers.

ceiling(.5) ? 1
ceiling(-.5) ? 0
ceiling(-5.5) ->  -5
round(-5.5, 0) ->  -6

See Also